﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfLockScreen.Views
{
    /// <summary>
    /// Pet.xaml 的交互逻辑
    /// </summary>
    public partial class Pet : Window
    {
        public Pet()
        {
            InitializeComponent();
            window.WindowStartupLocation = WindowStartupLocation.Manual;//在指定位置显示
            double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth-35;
            //double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
            window.Left = screenWidth;
            window.Top = 35;
        }
        
        private void window_Loaded(object sender, RoutedEventArgs e)
        {
            this.MouseDown += Grid_MouseDown;
        }
        private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left)
            {
                DragMove();
            }
        } 
    }
}
